package com.atguigu.springcloud;

import com.atguigu.springcloud.entities.CommonResult;
import com.atguigu.springcloud.entities.Payment;
import com.atguigu.springcloud.service.PaymentService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author csc
 * @Date 2023/3/15 0015 15:26
 * @Version 1.0
 */
@RestController
public class OrderFeignController {

    @Resource
    private PaymentService paymentService;

    @GetMapping("/consumer/payment/get/{id}")
    public CommonResult<Payment> getPaymentById(@PathVariable("id")Long id){
       return  paymentService.getPaymentByid(id);
    }


    @GetMapping(value = "/consumer/payment/feign/timeout")
    public String paymentFeignTimeout(){
     //openFeign-ribbon, 客户端一般默认等待一秒钟
        return paymentService.paymentFeignTimeout();
    }//end

    @GetMapping(value = "/consumer/payment/zipkin")
    public String paymentZipkin(){
        //openFeign-ribbon, 客户端一般默认等待一秒钟
        return paymentService.paymentZipkin();
    }//end







}
